1. Technical Field
The present invention relates in general to a method and system for data processing and, in particular, to a method and system for emulating differing architectures in a data processing system. Still more particularly, the present invention relates to a method and system for emulating guest branch instructions in a data processing system.
2. Description of the Related Art
The PowerPC.TM. architecture is a high-performance reduced instruction set (RISC) processor architecture that provides a definition of the instruction set, registers, addressing modes, and the like, for a family of computer systems. The PowerPC.TM. architecture is somewhat independent of the particular construction of the microprocessor chips or chips utilized to implement an instance of the architecture and has accordingly been constructed in various implementations, including the PowerPC 601.TM., 602.TM., 603.TM., and 604.TM.. The design and operation of these processors have been described in published manuals such as the PowerPC 604.TM. RISC Microprocessor User's Manual, which is available from IBM Microelectronics as Order No. MPR604UMU-01 and is incorporated herein by reference.
As is true for many contemporary processors, a RISC architecture was chosen for the PowerPC.TM. because of the inherently higher performance potential of RISC architectures compared to CISC (complex instruction set computer) architectures. While it is desirable to optimize the design of a RISC processor to maximize the performance of the processor when executing native RISC instructions, it is also desirable to promote compatibility by accommodating commercial software written for CISC processors such as the Intel x86 and Motorola 68K.
Accordingly, an emulator mechanism can be incorporated into a PowerPC.TM. processor as disclosed in above-referenced Ser. Nos. 08/591,291 and 08/581,793. The disclosed emulation mechanism allows guest instructions (e.g., variable-length CISC instructions) to be emulated by executing corresponding semantic routines formed from native RISC instructions. Thus, the processor is required to manage two distinct instruction streams: a guest instruction stream containing the instructions to be emulated and a native instruction stream containing the native instructions within the semantic routines utilized to emulate the guest instructions. In order to maintain high performance when emulating guest instructions, an efficient mechanism is needed within the processor for managing both the guest and native instruction steams, with provision for branching and exception handling.